﻿using System;
using UnityEngine;
using System.Collections;
using DG.Tweening;
using UnityEngine.UI;

public class RecTipsPanel : MonoBehaviour
{
    public GameObject backBtn;
    public GameObject cancleBtn;
    public Action OnAction;
    public Text coText;


    public void OnShowRec(Action ac,string str)
    {
        Debug.Log("弹出============"+str);
        transform.localScale = new Vector3(0, 0, 0);
        transform.DOScale(new Vector3(1, 1, 1), 0.3f).SetEase(Ease.OutBack);
        coText.text = str;
        OnAction = ac;
    }

	// Use this for initialization
	void Start ()
	{

	    EventTriggerListener.Get(backBtn).onClick = OkToPrintClose;
        EventTriggerListener.Get(cancleBtn).onClick = OkToCancle;

    }



    public void OkToPrintClose(GameObject obj)
    {
        transform.localScale = new Vector3(1, 1, 1);

        transform.DOScale(new Vector3(0, 0, 0), 0.3f).SetEase(Ease.OutBack);
        OnAction();
    }

    public void OkToCancle(GameObject obj)
    {
        transform.localScale = new Vector3(1, 1, 1);
        transform.DOScale(new Vector3(0, 0, 0), 0.3f).SetEase(Ease.OutBack);
    }

    // Update is called once per frame
    void Update () {
	
	}

}
